<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="keywords" content="">
    <meta name="description" content="">
    <meta name="renderer" content="webkit">
    <meta name="viewport" content="width=device-width, initial-scale=1,user-scalable=no">
    <title>欢迎语</title>
    <link rel="stylesheet" href="css/base.css">
    <link rel="stylesheet" href="css/im.css">
    <style>
        html,
        body {
            height: 100%;
            overflow: hidden;
            background: #f7f7f7;
        }
    </style>
</head>

<body>
    <div class="wrap">
        <div class="dw_t">新患者发起咨询时将自动推送</div>
        <div class="input_Dw">
            <div contentEditable="true" class="dw_input">你好,我是*****医生,欢迎关注我。请先留言，我会尽快回复，但由于医院工作较忙，若未能及时回复，敬请谅解。为方便我了解信息，请你预先填写预诊单</div>
            <span>72/300</span>
        </div>
        <div class="footer_dw">保存</div>
    </div>

    <script src="js/jquery-1.8.3.js"></script>
    <script src="js/im.js"></script>
    <script>
        $(".dw_input").keyup(function() {
            var len = $(this).text().toString().length;
            $(".input_Dw span").html(len + "/300");

        })
        $(".dw_input")[0].addEventListener("input", function() {
            var len = $(this).text().toString().length;
            console.log(len)
            if (len > 300) {

                $(this).attr("contentEditable", "false")
            }
        })

        var arr = [];
        for (var i = 0; i < 31; i++) {
            var na = {
                ri: (1 + i) + "日",
                val: 1
            }
            arr.push(na)
        }
        console.log(arr)
    </script>
</body>

</html>